home *** CD-ROM | disk | FTP | other *** search
/ Mac Format 1996 April / MacFormat CD Edition MF36 (April 1996).iso / Shareware City / Developers / Tools Plus - GUI⁄Event libs / Tools Plus 2.6.1a Evaluat'n Kit / Tools Plus 2.6.1a / User Manual / 14-System Polling (3 of 4) < prev    next >
INI File  |  1994-12-12  |  31KB  |  649 lines

  1. [Display using Monaco 9]
  2.  
  3.  
  4. doNothing (event)
  5. `````````````````
  6. No event has occurred.  Also called a “null event.”
  7.  
  8.   The doNothing event indicates that the event queue is empty and that no event has occurred.  This occurs only when PollSystem returns with a value of false.
  9.  
  10. Programming Considerations
  11. ``````````````````````````
  12. • If your application does “background processing,” that is, it performs
  13.   an on-going process while it is waiting for events, it should perform
  14.   “one cycle” of its background process each time it receives a
  15.   doNothing event.  A single cycle of your application’s background
  16.   process should take no longer than 1/60 of a second.  See the
  17.   SetNullTime routine to set the interval at which your application
  18.   receives doNothing events.
  19.  
  20. • Picture buttons with the “repeating events” option turned on may
  21.   produce doNothing events if your application calls PollSystem more
  22.   frequently than the button changes its value.  This will cause no ill
  23.   side-effects, but you should be aware of this
  24.  
  25. ------------------------------------------------------------------------
  26.  
  27. doChgWindow (event)
  28. ```````````````````
  29. Request to activate an inactive window that belongs to your application.
  30.  
  31.   The request to activate an inactive window is made in response to the user clicking anywhere on an inactive window that belongs to your application.  However, there is one exception.  If the user clicks in an inactive window’s title bar while holding the Command key, the window is dragged without being activated.
  32.  
  33. Programming Considerations
  34. ``````````````````````````
  35. • A window can be activated by using the ActivateWindow procedure.
  36.  
  37. • If the active window has an active editing field, you may want to
  38.   validate the edited text before allowing the user to activate another
  39.   window.  If this is the case, use GetFieldString to obtain a copy of
  40.   the edited text, then your application can check the string for
  41.   errors.  If an error is detected, display an appropriate alert box and
  42.   ignore the doChgWindow event.  If no error is detected, call the
  43.   SaveFieldString procedure to save the edited text as the field’s
  44.   string, then activate the required window.
  45.  
  46. • If your application decides not to allow the user to activate a
  47.   window, it should display an appropriate alert box to explain why.
  48.  
  49. • The doChgWindow event will never occur when a modal window is active,
  50.   or when the watch cursor is displayed since other windows belonging to
  51.   your application cannot be clicked.
  52.  
  53. • A doChgWindow event does not occur if the user clicks on a tool bar or
  54.   floating palettes.
  55.  
  56. • If your application is running under Finder (System 6 or prior), a
  57.   doChgWindow event will not occur when the user [1] clicks a desk
  58.   accessory from an active window, [2] clicks a desk accessory from
  59.   another active desk accessory, or [3] clicks the previously active
  60.   window from an active desk accessory.  These are all handled
  61.   automatically.
  62.  
  63. Valid Polling Record Fields
  64. ```````````````````````````
  65. Poll.Window
  66.  
  67. ------------------------------------------------------------------------
  68.  
  69. doRefresh (event)
  70. `````````````````
  71. A window’s contents need to be refreshed (redrawn) after Tools Plus has refreshed its own objects.
  72.  
  73.   Your application must respond to this event.  The doRefresh event occurs when a window is completely or partially obscured, then becomes uncovered.  Tools Plus takes care of redrawing buttons, scroll bars, editing fields, list boxes, pop-up menus, picture buttons and custom controls.  Your application must take care of refreshing anything else, such as icons, pictures, lines, or text that it may have put in the window.  When your application receives this event, Tools Plus will have already drawn its objects.
  74.  
  75.   When a doRefresh event is reported, the window’s “update region” defines the exact area that needs to be refreshed, excluding the objects drawn by Tools Plus (buttons, scroll bars, editing fields, list boxes, pop-up menus, picture buttons and custom controls).  Although you can redraw everything in the window, the actual drawing is limited to the parts of the window that are visible and which need refreshing (Tools Plus changes the window’s update region to exclude its own objects).
  76.  
  77.   Your application can ignore the doRefresh event if you have chosen to do all the necessary drawing in response to a doPreRefresh event, or if the only objects in the window are drawn by Tools Plus (buttons, picture buttons, scroll bars, editing fields, list boxes, pop-up menus, and custom controls).
  78.  
  79. Programming Considerations
  80. ``````````````````````````
  81. • If your application did not put anything in the window except buttons,
  82.   picture buttons, scroll bars, editing fields, list boxes, pop-up
  83.   menus, and custom controls, it can ignore this event.
  84.  
  85. • If your application responds to a doRefresh event, it should do so in
  86.   the following manner:
  87.  
  88.  
  89. CurrentWindow(Poll.Window);            {Make the affected window the   }
  90.                                        {  current grafPort.            }
  91. BeginUpdate(WindowPointer(Poll.Window));{Drawing will occur only within}
  92.                                         {  the area that needs         }
  93.                                         {  refreshing (includes all    }
  94.                                         {  monitors).                  }
  95. for theScreen:=1 to NumberOfScreens do {Repeat drawing for each monitor}
  96.   begin                                {  in which the window appears. }
  97.     BeginUpdateScreen(theScreen);      {Drawing area reduced to the    }
  98.                                        {  specified screen.            }
  99.  
  100.     {   …insert your color-dependent drawing code here…   }
  101.  
  102.     EndUpdateScreen;                   {End the drawing for this       }
  103.                                        {  monitor, and restore the     }
  104.                                        {  window’s visible (drawing)   }
  105.   end;                                 {  region.                      }
  106.  
  107.  {   …insert your color-independent drawing code here…   }
  108.  
  109. EndUpdate(WindowPointer(Poll.Window)); {End the update for the window  }
  110. CurrentWindowReset;                    {Reset the current window to be }
  111.                                        {  the same as the active window}
  112.                                        {  (optional command).          }
  113.  
  114.  
  115. • BeginUpdate temporarily sets the window’s visRgn (visible region where
  116.   drawing occurs) to the intersection of the visRgn and updateRgn
  117.   (region requiring updating).  This effectively restricts drawing to
  118.   the area that needs updating.  Tools Plus removes its own objects
  119.   (buttons, scroll bars, editing fields, list boxes, pop-up menus,
  120.   picture buttons and custom controls) from the updateRgn, so you don’t
  121.   have to worry about accidentally drawing over those objects
  122.  
  123. • It is possible that several windows will need to be refreshed
  124.   simultaneously if, if for instance, a closing window exposed three
  125.   windows behind it.  PollSystem reports a single doRefresh event each
  126.   time it is called in the event loop, one event for each window that
  127.   needs refreshing.
  128.  
  129. • Unlike ordinary Macintosh applications, a doRefresh event is not
  130.   generated when a window is first opened.
  131.  
  132. • A doRefresh event is not generated for desk accessories, the Dialog
  133.   Manager’s dialogs, alerts, or Dynamic Alerts.  These events are
  134.   handled automatically.
  135.  
  136. • When responding to a doRefresh event, your application should limit
  137.   itself to activities that pertain only to refreshing the specified
  138.   window.  Do not create or modify user interface elements, open, close,
  139.   or move windows.
  140.  
  141. • See the doPreRefresh event if your application needs to refresh all or
  142.   part of the window before Tools Plus refreshes its own objects
  143.   (buttons, picture buttons, scroll bars, editing fields, list boxes,
  144.   pop-up menus, and custom controls).
  145.  
  146. Valid Polling Record Fields
  147. ```````````````````````````
  148. Poll.Window
  149.  
  150. ------------------------------------------------------------------------
  151.  
  152. doPreRefresh (event)
  153. ````````````````````
  154. A window’s contents may be refreshed (redrawn) before Tools Plus refreshes its own objects.
  155.  
  156.   Most applications will ignore this event.  A doPreRefresh event is reported before each doRefresh event (which occurs when a window is completely or partially obscured, then becomes uncovered and needs to be redrawn).  The doPreRefresh event lets your application draw or display objects before Tools Plus draws its own objects (buttons, picture buttons, scroll bars, editing fields, list boxes, pop-up menus, and custom controls).
  157.  
  158.   An example of the doPreRefresh event’s usefulness is if your application displays a picture as a window’s background.  When your application receives a doPreRefresh event, it can draw the background picture only.  The next time your application calls PollSystem, Tools Plus will refresh all its own objects and report a doRefresh event for your application to process.
  159.  
  160.   When a doPreRefresh event is reported, the window’s “update region” defines the exact area that needs to be refreshed.  Although you can redraw everything in the window, the actual drawing is limited to the parts of the window that are visible and which need refreshing.
  161.  
  162. Programming Considerations
  163. ``````````````````````````
  164. • If your application did not put anything in the window except buttons,
  165.   picture buttons, scroll bars, editing fields, list boxes, pop-up
  166.   menus, and custom controls, it should ignore the doPreRefresh event.
  167.  
  168. • If your application responds to a doPreRefresh event, it should do so
  169.   in the following manner:
  170.  
  171.  
  172. CurrentWindow(Poll.Window);            {Make the affected window the   }
  173.                                        {  current grafPort.            }
  174. BeginUpdate(WindowPointer(Poll.Window));{Drawing will occur only within}
  175.                                         {  the area that needs         }
  176.                                         {  refreshing (includes all    }
  177.                                         {  monitors).                  }
  178. for theScreen:=1 to NumberOfScreens do {Repeat drawing for each monitor}
  179.   begin                                {  in which the window appears. }
  180.     BeginUpdateScreen(theScreen);      {Drawing area reduced to the    }
  181.                                        {  specified screen.            }
  182.  
  183.     {   …insert your color-dependent drawing code here…   }
  184.  
  185.     EndUpdateScreen;                   {End the drawing for this       }
  186.                                        {  monitor, and restore the     }
  187.                                        {  window’s visible (drawing)   }
  188.   end;                                 {  region.                      }
  189.  
  190.  {   …insert your color-independent drawing code here…   }
  191.  
  192. EndUpdate(WindowPointer(Poll.Window)); {End the update for the window  }
  193. CurrentWindowReset;                    {Reset the current window to be }
  194.                                        {  the same as the active window}
  195.                                        {  (optional command).          }
  196.  
  197.  
  198. • BeginUpdate temporarily sets the window’s visRgn (visible region where
  199.   drawing occurs) to the intersection of the visRgn and updateRgn
  200.   (region requiring updating).  This effectively restricts drawing to
  201.   the area that needs updating.  The affected area may include Tools
  202.   Plus objects which are automatically refreshed the next time
  203.   PollSystem is called.
  204.  
  205. • It is possible that several windows will need to be refreshed
  206.   simultaneously if, for instance, a closing window exposed three
  207.   windows behind it.  PollSystem reports a single doPreRefresh event
  208.   (followed by a doRefresh event) each time it is called in the event
  209.   loop, one event for each window that needs refreshing.
  210.  
  211. • Unlike ordinary Macintosh applications, a doPreRefresh event is not
  212.   generated when a window is first opened.
  213.  
  214. • A doPreRefresh event is not generated for desk accessories, the Dialog
  215.   Manager’s dialogs, alerts, or Dynamic Alerts.  These events are
  216.   handled automatically.
  217.  
  218. • When responding to a doPreRefresh event, your application should limit
  219.   itself to activities that pertain only to refreshing the specified
  220.   window.  Do not create or modify user interface elements, open, close,
  221.   or move windows.
  222.  
  223. Valid Polling Record Fields
  224. ```````````````````````````
  225. Poll.Window
  226.  
  227. ------------------------------------------------------------------------
  228.  
  229. doGoAway (event)
  230. ````````````````
  231. Request to close the active window.
  232.  
  233.   The request to close the active window is made in response to the user clicking inside the window’s “close” box.  This has the same effect as choosing the File menu’s Close item.
  234.  
  235. Programming Considerations
  236. ``````````````````````````
  237. • A window is closed by using the WindowClose procedure.
  238.  
  239. • If the window has an active editing field, you may want to validate
  240.   its edited text before allowing the user to close the window.  If this
  241.   is the case, use GetFieldString to obtain a copy of the edited text,
  242.   then your application can check the string for errors.  If an error is
  243.   detected, display an appropriate alert box and ignore the doGoAway
  244.   event.  If no error is detected, call the SaveFieldString procedure to
  245.   save the edited text as the field’s string, then close the required
  246.   window.
  247.  
  248. • If any changes have been made in the window’s data, your application
  249.   should display an appropriate alert box and ask the user if changes
  250.   should be saved.  The options should be Yes, No, and Cancel, the last
  251.   of which would ignore the doGoAway event.
  252.  
  253. • The doGoAway event will never occur when the watch cursor is
  254.   displayed, since the close box cannot be clicked.
  255.  
  256. • A doGoAway event is not generated when the user clicks a desk
  257.   accessory’s close box.  The desk accessory is closed automatically.
  258.  
  259. • You may want to consider hiding a window (with the WindowDisplay
  260.   routine) instead of closing it in situations where a window is opened
  261.   and closed frequently, such as a floating palette or tool bar.  Hiding
  262.   and showing a window preserves the window’s setting and location, and
  263.   is much faster than opening a window and recreating the user interface
  264.   elements.  However, hiding a window does not release the memory
  265.   consumed by the objects in the window (such as picture buttons, list
  266.   boxes, etc.)
  267.  
  268. Valid Polling Record Fields
  269. ```````````````````````````
  270. Poll.Window
  271. Poll.Modifiers
  272.  
  273. ------------------------------------------------------------------------
  274.  
  275. doButton (event)
  276. ````````````````
  277. Indicator that user has clicked a button.
  278.  
  279.   The doButton event reports that the user has clicked a button in the active window.  This includes push buttons, check boxes and radio buttons.  The doButton event is also reported if the active window has a default push-button, and the user pressed the Return or Enter key to invoke the default.  If this is the case, the window’s default button will already have been “flashed” as if the user had clicked it.
  280.  
  281. Programming Considerations
  282. ``````````````````````````
  283. • If the user clicked a check box, use SelectButton to reverse the check
  284.   box’s selection (i.e. select or deselect it).
  285.  
  286. • If the user clicked a radio button, use SelectButton to select the
  287.   radio button, and to deselect the other buttons in the radio button’s
  288.   group.
  289.  
  290. • This event will never occur when the watch cursor is displayed, since
  291.   buttons cannot be clicked.  The exception is if the WatchCursorButtons
  292.   procedure has been used to allow the watch cursor to click push-
  293.   buttons.
  294.  
  295. • If your application responds to double-clicks in radio buttons and
  296.   Poll.Button.DoubleClick is true, consider the event to mean “click
  297.   button and OK,” in which case the default button should be flashed and
  298.   the appropriate action taken.
  299.  
  300. • A doButton event is not generated when the user clicks buttons in a
  301.   dialog box, alert box, or desk accessory.  These events are handled
  302.   automatically.
  303.  
  304. Valid Polling Record Fields
  305. ```````````````````````````
  306. Poll.Window
  307. Poll.Button.Num
  308. Poll.Button.DoubleClick
  309. Poll.Modifiers
  310.  
  311. ------------------------------------------------------------------------
  312.  
  313. doMenu (event)
  314. ``````````````
  315. Indicator that the user selected a pull-down or hierarchical menu item.
  316.  
  317.   The user selected a pull-down or hierarchical menu by either clicking in the menu bar and selecting an item, or by typing a Command key equivalent for a menu item.
  318.  
  319. Programming Considerations
  320. ``````````````````````````
  321. • The menu’s name in the menu bar is automatically highlighted (white
  322.   letters on black background) when the user makes a menu selection.
  323.   Your application must call MenuHilite(0) to remove the highlighting
  324.   when it is finished with its process.
  325.  
  326. • If a hierarchical menu item is selected, the name of its ultimate
  327.   parent menu is highlighted in the menu bar (white letters on black
  328.   background).  Your application must call MenuHilite(0) to remove the
  329.   highlighting when it is finished with its process.  If a Command key
  330.   equivalent for a hierarchical menu item is typed, and the hierarchical
  331.   menu is not ultimately attached to a pull-down menu, a doKeyDown or
  332.   doAutoKey event is reported instead (as though the hierarchical menu
  333.   did not exist).
  334.  
  335. • This event will never occur when a modal window is active, or when the
  336.   watch cursor is displayed since the menu cannot be clicked and Command
  337.   key equivalents are ignored.
  338.  
  339. • If the active window has an active editing field, PollSystem will
  340.   process the Edit menu’s Undo, Cut, Copy, Paste, and Clear commands
  341.   automatically.  These selections will not generate doMenu events.
  342.  
  343. • A doMenu event is not generated when the user selects desk accessory
  344.   menus.  These selections are handled automatically.
  345.  
  346. Valid Polling Record Fields
  347. ```````````````````````````
  348. Poll.Menu.Num
  349. Poll.Menu.Item
  350. Poll.Modifiers
  351.  
  352. ------------------------------------------------------------------------
  353.  
  354. doKeyDown (event)
  355. `````````````````
  356. Indicator that the user pressed down a key.
  357.  
  358. The user has pressed down a key on the keyboard or numeric pad, and the key cannot be processed internally by Tools Plus.
  359.  
  360. Programming Considerations
  361. ``````````````````````````
  362. • This event is generated only if the key can not be processed
  363.   internally by Tools Plus.
  364.  
  365. • Command key sequences that are equivalents to menu items generate 
  366.   doMenu events.
  367.  
  368. • If a Command key equivalent for a hierarchical menu item is typed, and
  369.   the hierarchical menu is not ultimately attached to a pull-down menu,
  370.   a doKeyDown or doAutoKey event is reported instead (as though the
  371.   hierarchical menu did not exist).
  372.  
  373. • The Modifiers field tells your application if the key down event was a
  374.   Command key sequence.  All Command key sequences that are not menu
  375.   equivalents are returned to your application as doKeyDown or doAutoKey
  376.   events.  If your application gets such a Command key sequence, it
  377.   should carry out the appropriate action, or beep the user if the
  378.   Command key sequence is illegal.
  379.  
  380. • If Return or Enter are typed when the active window has a default
  381.   button, a doButton event is reported for the default button.
  382.  
  383. • If an active editing field exists on the active window, key strokes
  384.   will affect the field and will not generate events.  This applies even
  385.   if the field’s length is limited, or if Return has been disallowed in
  386.   a field.
  387.  
  388. • If Tab is typed and the window contains an active editing field, it
  389.   indicates that the user wants to tab to the next field.  Shift-Tab
  390.   indicates tabbing to the previous field.  You may want to validate a
  391.   field’s edited text before allowing the user to tab to the new field.
  392.   If this is the case, use GetFieldString to obtain a copy of the edited
  393.   text, then your application can check the string for errors.  If an
  394.   error is detected, display an appropriate alert box and ignore the
  395.   doKeyDown event.  If no error is detected, call the SaveFieldString
  396.   procedure to save the edited text as the field’s string, then activate
  397.   the new field by using the ActivateField procedure.
  398.  
  399. • A Return key is reported only if the window does not have a default
  400.   button or active field.
  401.  
  402. • If Enter is typed, it usually indicates that the user wants to enter
  403.   the screen’s data.  This is the same process that is carried out by
  404.   clicking an OK button.  See “Tab” above, regarding validating and
  405.   saving a field’s edited text.  An Enter key is reported only if the
  406.   window does not have a default button.
  407.  
  408. • When the watch cursor is displayed, the only doKeyDown event that will
  409.   be reported is a Command-., which indicates that the user is halting a
  410.   lengthy process.  Other doKeyDown events are discarded.
  411.  
  412. • If the active window has an active editing field, PollSystem
  413.   automatically processes the Command key equivalents for the Edit
  414.   menu’s Undo, Cut, Copy, and Paste commands.  These selections do not
  415.   generate events.
  416.  
  417. • There are two situations where several keys produce the same key
  418.   character: the Clear and Escape keys, and the F1 through F15 keys.  In
  419.   these cases, use the key code to differentiate the keys.  Constants
  420.   are provided for these key characters and key codes.
  421.  
  422. • A doKeyDown event is not generated when the user types in a desk
  423.   accessory.  These key strokes are handled automatically.
  424.  
  425. Valid Polling Record Fields
  426. ```````````````````````````
  427. Poll.Window
  428. Poll.Key.Code
  429. Poll.Key.Chr
  430. Poll.Modifiers
  431.  
  432. ------------------------------------------------------------------------
  433.  
  434. doAutoKey (event)
  435. `````````````````
  436. Indicator that the user held down a key, and it is repeating.
  437.  
  438. The user has pressed down a key on the keyboard or numeric pad, and the key is repeating.  The key cannot be processed internally by Tools Plus.  In most cases, this event should be treated identically to a doKeyDown event.  Each doAutoKey event will follow a doKeyDown of the same sort, so your application may want to make some repeating Command key sequences illegal.
  439.  
  440. Programming Considerations
  441. ``````````````````````````
  442. • This event is generated only if the key can not be processed
  443.   internally by Tools Plus.
  444.  
  445. • Command key sequences that are equivalents to menu items generate
  446.   doMenu events.
  447.  
  448. • If a Command key equivalent for a hierarchical menu item is typed, and
  449.   the hierarchical menu is not ultimately attached to a pull-down menu,
  450.   a doKeyDown or doAutoKey event is reported instead (as though the
  451.   hierarchical menu did not exist).
  452.  
  453. • The Modifiers field tells your application if the repeating key down
  454.   event was a Command key sequence.  All Command key sequences that are
  455.   not menu equivalents are returned to your application as doKeyDown or
  456.   doAutoKey events.  If your application gets such a Command key
  457.   sequence, it should carry out the appropriate action, or beep the user
  458.   if the Command key sequence is illegal.
  459.  
  460. • If Return or Enter are typed and held down when the active window has
  461.   a default button, a doButton event is reported for the default button.
  462.  
  463. • If an active editing field exists on the active window, repeating keys
  464.   will affect the field and will not generate events.  This applies even
  465.   if the field’s length is limited, or if Return has been disallowed in
  466.   a field.
  467.  
  468. • If Tab is typed and the window contains an active editing field, it
  469.   indicates that the user wants to tab to the next field.  Shift-Tab
  470.   indicates tabbing to the previous field.  You may want to validate a
  471.   field’s edited text before allowing the user to tab to the new field.
  472.     If this is the case, use GetFieldString to obtain a copy of the
  473.   edited text, then your application can check the string for errors.
  474.   If an error is detected, display an appropriate alert box and ignore
  475.   the doKeyDown event.  If no error is detected, call the
  476.   SaveFieldString procedure to save the edited text as the field’s
  477.   string, then activate the new field by using the ActivateField
  478.   procedure.
  479.  
  480. • A Return key is reported only if the window does not have a default
  481.   button or active field.
  482.  
  483. • If Enter is typed, it usually indicates that the user wants to enter
  484.   the screen’s data.  This is the same process that is carried out by
  485.   clicking an OK button.  See “Tab” above, regarding validating and
  486.   saving a field’s edited text.  An Enter key is reported only if the
  487.   window does not have a default button.  The repeating Enter key may be
  488.   considered illegal because a doKeyDown event will report the first
  489.   Enter, after which your application should have acted accordingly.  An
  490.   Enter key is reported only if the window does not have a default
  491.   button.
  492.  
  493. • When the watch cursor is displayed, the only doAutoKey event that will
  494.   be reported is a Command-., which is the user’s request to halt a
  495.   lengthy process.  Other doAutoKey events are discarded.
  496.  
  497. • If the active window has an active editing field, PollSystem
  498.   automatically processes the Command key equivalents for the Edit
  499.   menu’s Undo, Cut, Copy, and Paste commands.  These selections do not
  500.   generate events.
  501.  
  502. • There are two situations where several keys produce the same key
  503.   character: the Clear and Escape keys, and the F1 through F15 keys.  In
  504.   these cases, use the key code to differentiate the keys.  Constants
  505.   are provided for these key characters and key codes.
  506.  
  507. • A doAutoKey event is not generated when the user types in a desk
  508.   accessory.  These key strokes are handled automatically.
  509.  
  510. Valid Polling Record Fields
  511. ```````````````````````````
  512. Poll.Window
  513. Poll.Key.Code
  514. Poll.Key.Chr
  515. Poll.Modifiers
  516.  
  517. ------------------------------------------------------------------------
  518.  
  519. doKeyUp (event)
  520. ```````````````
  521. Indicator that the user released a key.
  522.  
  523. The user has released a key on the keyboard or numeric pad, and the key cannot be processed internally by Tools Plus.  Normally the Macintosh does not report doKeyUp events nor do applications typically respond to them.  See “Key-Up Events” in the Designing Your Application chapter for details on the SetEventMask procedure.
  524.  
  525. Programming Considerations
  526. ``````````````````````````
  527. • This event is generated only if your application has used the
  528.   SetEventMask procedure to make the Macintosh respond to key-up events,
  529.   and if the active window does not have an active editing field.
  530.  
  531. • Tools Plus and desk accessories do not require key-up events, and
  532.   therefore ignore them.
  533.  
  534. • There are two situations where several keys produce the same key
  535.   character: the Clear and Escape keys, and the F1 through F15 keys.  In
  536.   these cases, use the key code to differentiate the keys.  Constants
  537.   are provided for these key characters and key codes.
  538.  
  539. • When the watch cursor is displayed, all doKeyUp events are discarded
  540.   and are not generated.
  541.  
  542. Valid Polling Record Fields
  543. ```````````````````````````
  544. Poll.Window
  545. Poll.Key.Code
  546. Poll.Key.Chr
  547. Poll.Modifiers
  548.  
  549. ------------------------------------------------------------------------
  550.  
  551. doClickField (event)
  552. ````````````````````
  553. Indicator that the user clicked in an inactive editing field.
  554.  
  555. When the user clicks in an inactive editing field in the active window, it indicates that the user has finished working with the currently active field and wants to start working with the one that was clicked.  Tools Plus automatically supports the full range of Macintosh user interface options for editing fields, including (but not limited to):
  556.   • clicking in the field, thereby placing an insertion point
  557.   • dragging across characters to create a selection
  558.   • double-clicking a word to select it
  559.  
  560. Programming Considerations
  561. ``````````````````````````
  562. • The ClickInField procedure is used to process a user’s click in an
  563.   inactive editing field.  It could be in the same window that the user
  564.   is working in, or it could be in a tool bar or floating palette
  565.  
  566. • If an editing field is active when you receive a doClickField event,
  567.   you may want to validate its edited text before allowing the user to
  568.   click to the new field.  If this is the case, use GetFieldString to
  569.   obtain a copy of the edited text, then your application can check the
  570.   string for errors.  If an error is detected, display an appropriate
  571.   alert box and ignore the doClickField event.  If no error is detected,
  572.   call the SaveFieldString procedure to save the edited text as the
  573.   field’s string, then call the ClickInField procedure to process the
  574.   user’s click in the new field.
  575.  
  576. • Between the time that the doClickField event is reported and the
  577.   ClickInField procedure is used as a response, observe the following
  578.   rules:
  579.       • do not call PollSystem
  580.       • do not open or close any windows, including alerts and dialogs
  581.       • do not hide or show any windows
  582.       • do not activate any windows.
  583.   If these rules are not observed, ClickInField will do nothing and the
  584.   user’s click is ignored.
  585.  
  586. • An event will not occur if the user clicks in an editing field that is
  587.   already active.
  588.  
  589. • This event will never occur when the watch cursor is displayed, since
  590.   editing fields cannot be clicked.
  591.  
  592. • A doClickField event is not generated when the user clicks in a desk
  593.   accessory’s editing fields.  The process is handled automatically.
  594.  
  595. Valid Polling Record Fields
  596. ```````````````````````````
  597. Poll.Window
  598. Poll.Field
  599. Poll.Modifiers
  600.  
  601. ------------------------------------------------------------------------
  602.  
  603. doScrollBar (event)
  604. ```````````````````
  605. Indicator that user clicked in a scroll bar.
  606.  
  607. The doScrollBar event reports that the user has clicked somewhere in a scroll bar.  The scroll bar has 5 parts: up button, down button, “page up” region, “page down” region, and the thumb.  In all cases, your application should respond to the scroll bar event by scrolling the window’s contents (or portion thereof) and drawing any parts that have been newly revealed due to scrolling.
  608.  
  609. Programming Considerations
  610. ``````````````````````````
  611. • If the scroll bar’s thumb was moved, your application can obtain the
  612.   current value of the scroll bar by calling GetScrollBarVal.  By using
  613.   this value, your application can determine how much to scroll.
  614.  
  615. • If the scroll bar’s up button, down button, “page up” region, or “page
  616.   down” region was clicked, your application must scroll the window by
  617.   the correct amount, then change the scroll bar’s value by using
  618.   SetScrollBarVal.
  619.  
  620. • If the up arrow or “page up” region is clicked, subtract the correct
  621.   amount from the current value.  If the down arrow or “page down”
  622.   region is clicked, add the correct amount to the current value.
  623.  
  624. • If the user holds the mouse button down in the up arrow, “page up”
  625.   region, down arrow, or “page down” region, PollSystem returns a single
  626.   doScrollBar event each time PollSystem is called.  Your application
  627.   doesn’t have to be aware of this, but it is nice to know that scroll
  628.   bar events will not pile up in the queue.
  629.  
  630. • If the user moves the scroll bar’s thumb and returns it to its
  631.   original place during the same drag, an event is not generated.
  632.  
  633. • This event will never occur when the watch cursor is displayed, since
  634.   scroll bars cannot be clicked.
  635.  
  636. • Scroll bars that are part of a list box are handled automatically.
  637.  
  638. • A doScrollBar event is not generated when the user clicks scroll bars
  639.   in a dialog box or desk accessory.  These events are handled
  640.   automatically.
  641.  
  642. Valid Polling Record Fields
  643. ```````````````````````````
  644. Poll.Window
  645. Poll.ScrollBar.Num
  646. Poll.ScrollBar.Part
  647.  
  648. ------------------------------------------------------------------------
  649.